Below are the most commonly needed programmatic actions:
- To set the binding extender (all bindings on it) to online or offline from your code, set its Online property to true or false. The binding extender is a component placed on your form, so you can refer to it by its name.
- To execute the Read or Write operation on concrete binding, call the PointBinding’s ExecuteRead or ExecuteWrite method. Note that although the individual binding do not appear on the design surface (of the form) or on the component tray, they are still components of your form, and you can refer to individual bindings by their name (as of now, you cannot change the name from the binding collection editor, so you need to look it up in the designer-generated code, and either use it as is, or rename manually).
- To execute any of the operations on a concrete binding group (for all binding in that group that have that operation allowed), call a corresponding method on the PointBindingGroup object. The binding groups do not appear on thecomponent tray (of the form or window), but they are still components that belong to your form or window, and you can refer to them by their name. The name of the binding group can be viewed or modified in the Binding Group Collection Editor. The method names are PointBindingGroup.ExecuteRead, ExecuteSubscribe and ExecuteWrite. The ExecuteSubscribe has a bool argument that determines whether you want to subscribe or unsubscribe.
You can also override some of the error handling in live binding (see Error Model in Live Binding).
See Also